package erp.education.server.db.implementation.setup.school;

 

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import erp.education.server.db.entites.setup.school.Schools;
import erp.education.server.db.entites.setup.school.Streams;
import erp.education.server.db.implementation.common.BaseDAO;
import erp.education.server.db.interfaces.setup.school.StreamDAOI;
@Component("streamDao")
public class StreamDAO extends BaseDAO implements StreamDAOI {

	@Override
	public Streams getStream(Long branchId,String streamName) {
		// TODO Auto-generated method stub
		Streams stream=null;
		
		Map params=new HashMap();
		params.put("branchId", branchId);
		params.put("streamName", streamName);
		
		
		stream=(Streams)getSingleResult("select stream from Streams stream where stream.branchId=:branchId and stream.streamName=:streamName ", params);
	 
		 
		 
		return stream;
	}
	@Override
	public List<Object[]> getStreamGridList() {
		// TODO Auto-generated method stub
		List<Object[]> streams=null;
		Map params=new HashMap();
		
		streams=(List<Object[]>) getResultList("select school.schoolId,school.schoolName,branch.branchId,branch.branchName,stream.streamId,stream.streamName from Branchs branch,Streams stream,Schools school where stream.branchId=branch.branchId and school.schoolId=branch.schoolId ", params);
			return streams;
	}
}
